package controller.persiapan;

import helper.SearchEngine;
import java.awt.*;
import model.*;

public class Persiapan extends javax.swing.JFrame {

    //Attribute
    
    /** Creates new form Persiapan */
    
    @SuppressWarnings("static-access")
    public Persiapan() {
        initComponents();
        this.setLocationRelativeTo(null);
        this.getContentPane().add(this.jPanel1, BorderLayout.CENTER);
    }       
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        loadgame_label = new javax.swing.JLabel();
        newgame_label = new javax.swing.JLabel();
        exit_label = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        setUndecorated(true);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/model/persiapan/iniii.png"))); // NOI18N
        jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        loadgame_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/model/persiapan/loadgameA.jpg"))); // NOI18N
        loadgame_label.setAlignmentY(jLabel2.getAlignmentY());
        loadgame_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                loadgame_labelMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                loadgame_labelMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                loadgame_labelMouseExited(evt);
            }
        });

        newgame_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/model/persiapan/newgameA.jpg"))); // NOI18N
        newgame_label.setAlignmentY(jLabel2.getAlignmentY());
        newgame_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                newgame_labelMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                newgame_labelMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                newgame_labelMouseExited(evt);
            }
        });

        exit_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/model/persiapan/exitA.jpg"))); // NOI18N
        exit_label.setAlignmentY(jLabel2.getAlignmentY());
        exit_label.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                exit_labelMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                exit_labelMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                exit_labelMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(newgame_label)
                .addGap(0, 0, 0)
                .addComponent(loadgame_label)
                .addGap(0, 0, 0)
                .addComponent(exit_label))
            .addComponent(jLabel2, 0, 0, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel2)
                .addGap(0, 0, 0)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(exit_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(loadgame_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(newgame_label, 0, 0, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void newgame_labelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newgame_labelMouseEntered
        this.newgame_label.setIcon(SearchEngine.createImageIcon("persiapan/newgameB.jpg"));
    }//GEN-LAST:event_newgame_labelMouseEntered

    private void newgame_labelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newgame_labelMouseExited
        this.newgame_label.setIcon(SearchEngine.createImageIcon("persiapan/newgameA.jpg"));
    }//GEN-LAST:event_newgame_labelMouseExited

    private void loadgame_labelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadgame_labelMouseEntered
        this.loadgame_label.setIcon(SearchEngine.createImageIcon("persiapan/loadgameB.jpg"));
    }//GEN-LAST:event_loadgame_labelMouseEntered

    private void loadgame_labelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadgame_labelMouseExited
        this.loadgame_label.setIcon(SearchEngine.createImageIcon("persiapan/loadgameA.jpg"));
    }//GEN-LAST:event_loadgame_labelMouseExited

    private void exit_labelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exit_labelMouseEntered
        this.exit_label.setIcon(SearchEngine.createImageIcon("persiapan/exitB.jpg"));
    }//GEN-LAST:event_exit_labelMouseEntered

    private void exit_labelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exit_labelMouseExited
        this.exit_label.setIcon(SearchEngine.createImageIcon("persiapan/exitA.jpg"));
    }//GEN-LAST:event_exit_labelMouseExited

    private void newgame_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newgame_labelMouseClicked
        this.setVisible(false);
        new CreatePlayer(this).setVisible(true);
    }//GEN-LAST:event_newgame_labelMouseClicked

    private void loadgame_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadgame_labelMouseClicked
        this.setVisible(false);
        new LoadGame(this).setVisible(true);
    }//GEN-LAST:event_loadgame_labelMouseClicked

    private void exit_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exit_labelMouseClicked
        System.exit(0);

    }//GEN-LAST:event_exit_labelMouseClicked

    
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Persiapan().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel exit_label;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel loadgame_label;
    private javax.swing.JLabel newgame_label;
    // End of variables declaration//GEN-END:variables

}
